<template>
  <div>
    <Table :columns="columns" :data="data"></Table>
  </div>
</template>
<script>
export default {
  data() {
    return {
      columns: [
        {
          title: "类别",
          key: "type",
          render: (h, params) => {
            let row = params.row;
            return h("Input", {
              props: {
                value: row.type,
              },
              on: {
                "on-change": (e) => {
                  row.type = e.target.value;
                },
              },
            });
          },
        },
        {
          title: "中文名",
          key: "name",
          render: (h, params) => {
            let row = params.row;
            return h("Input", {
              props: {
                value: row.name,
              },
              on: {
                "on-change": (e) => {
                  row.name = e.target.value;
                },
              },
            });
          },
        },
        {
          title: "英文名",
          key: "enName",
          render: (h, params) => {
            let row = params.row;
            return h("Input", {
              props: {
                value: row.enName,
              },
              on: {
                "on-change": (e) => {
                  row.enName = e.target.value;
                },
              },
            });
          },
        },
        {
          title: "CAS编号",
          key: "CAS",
          render: (h, params) => {
            let row = params.row;
            return h("Input", {
              props: {
                value: row.CAS,
              },
              on: {
                "on-change": (e) => {
                  row.CAS = e.target.value;
                },
              },
            });
          },
        },
        {
          title: "SFo（(mg/kg-d)^-1）",
          key: "SF_o",
          render: (h, params) => {
            let row = params.row;
            return h("Input", {
              props: {
                value: row.SF_o,
                type:"number"
              },
              on: {
                "on-change": (e) => {
                  row.SF_o = e.target.value;
                },
              },
            });
          },
        },
        {
          title: "IUR((mg/m^3)^-1)",
          key: "IUR",
          render: (h, params) => {
            let row = params.row;
            return h("Input", {
              props: {
                value: row.IUR,
                type:"number"
              },
              on: {
                "on-change": (e) => {
                  row.IUR = e.target.value;
                },
              },
            });
          },
        },
        {
          title: "RfD_o（mg/kg-d）",
          key: "RfD_o",
          render: (h, params) => {
            let row = params.row;
            return h("Input", {
              props: {
                value: row.RfD_o,
                type:"number"
              },
              on: {
                "on-change": (e) => {
                  row.RfD_o = e.target.value;
                },
              },
            });
          },
        },
        {
          title: "RfC（mg/m^3）",
          key: "RfC",
          render: (h, params) => {
            let row = params.row;
            return h("Input", {
              props: {
                value: row.RfC,
                type:"number"
              },
              on: {
                "on-change": (e) => {
                  row.RfC = e.target.value;
                },
              },
            });
          },
        },
        {
          title: "ABSgi",
          key: "ABS_gi",
          render: (h, params) => {
            let row = params.row;
            return h("Input", {
              props: {
                value: row.ABS_gi,
                type:"number"
              },
              on: {
                "on-change": (e) => {
                  row.ABS_gi = e.target.value;
                },
              },
            });
          },
        },
        {
          title: "皮肤接触吸收效率因子ABS_d",
          key: "ABS_d",
          render: (h, params) => {
            let row = params.row;
            return h("Input", {
              props: {
                value: row.ABS_d,
                type:"number"
              },
              on: {
                "on-change": (e) => {
                  row.ABS_d = e.target.value;
                },
              },
            });
          },
        },
        {
          title: "是否致癌物",
          key: "cancer",
          render: (h, params) => {
            let row = params.row;
            return h("i-switch", {
              props: {
                value: row.cancer,
              },
              on: {
                "on-change": (e) => {
                  row.cancer = e;
                },
              },
            });
          },
        },
      ],
      data: [
        {
          type: "金属及无机物",
          name: "锑",
          enName:"Antimony",
          CAS:"7440-36-0",
          SF_o:0.001,
          IUR:0.001,
          RfD_o:0.001,
          RfC:0.001,
          ABS_gi:0.001,
          ABS_d: 0.03,
          cancer:true
        },
         {
          type: "金属及无机物",
          name: "砷(无机)",
          enName:"Arsenic, inorganic",
          CAS:"7440-36-0",
          SF_o:0.001,
          IUR:0.001,
          RfD_o:0.001,
          RfC:0.001,
          ABS_gi:0.001,
          ABS_d: 0.03,
          cancer:true
        },
        {
          type: "挥发性有机物",
          name: "丙酮",
          enName:"Acetone",
          CAS:"67-64-1",
          SF_o:0.001,
          IUR:0.001,
          RfD_o:0.001,
          RfC:0.001,
          ABS_gi:0.001,
          ABS_d: 0.03,
          cancer:true
        },
         {
          type: "金属及无机物",
          name: "砷(无机)",
          enName:"Benzene",
          CAS:"7440-36-0",
          SF_o:0.001,
          IUR:0.001,
          RfD_o:0.001,
          RfC:0.001,
          ABS_gi:0.001,
          ABS_d: 0.03,
          cancer:true
        }
      ],
    };
  },
};
</script>